#pragma	once

namespace	MomogenkyouSystem	{


//	To be inherited in Contents such as FPS, 3rd Person, Chase etc
class	Camera
{
protected:
	ALIGN(256)
	MATRIX		matView;
	MATRIX		matProjection;

	float4		m_vPosition;
	float4		m_vLook;
	float4		m_vUp;
	float4		m_vRight;
	float4		m_vFront;
public:
	Camera();
	virtual	~Camera();

	__inline	float4		Position()	const	{	return	m_vPosition;	}
	__inline	float4		Look()		const	{	return	m_vLook;		}
	__inline	float4		Up()		const	{	return	m_vUp;			}
	__inline	float4		Right()		const	{	return	m_vRight;		}
	__inline	float4		Front()		const	{	return	m_vFront;		}

	__inline	MATRIX *	ViewMatrix()		{	return	&matView;		}
	__inline	MATRIX *	ProjectionMatrix()	{	return	&matProjection;	}

	void					SetPositionLook(const float4 & Position, const float4 & Look);
	void					SetPosition(const float4 & Position);
	void					SetLook(const float4 & Look);

	//	Calculate the view matrix and set to the device
	void					CalculateView();
	//	Calculate the Projection Matrix(Perspective) and set to the device
	void					CalculatePerspective(const float & FOV, const float & AspectRatio, const float & Near, const float & Far);
	//	Calculate the Projecction Matrix(Orthographic) and set to the device
	void					CalculateOrthographic(const float & Width, const float & Height, const float & Near, const float & Far);

	//	Updates the camera, this does nothing unless over written.
	virtual	void			Update(const float & Interval)	{	UNREFERENCED_PARAMETER(Interval);	}
};

}